package com.nchu.commondevelopmentframework.converter;

import com.nchu.commondevelopmentframework.dto.LoginUserDTO;
import com.nchu.commondevelopmentframework.entity.User;
import com.nchu.commondevelopmentframework.vo.UserMenuVO;
import com.nchu.commondevelopmentframework.vo.UserVO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @InterfaceName: UserConverter
 * @description: User对象转换类
 * @author: Li Chuanwei
 * @date: 2024/02/23 14:26
 **/
@Mapper
public interface UserConverter {
    UserConverter INSTANCE = Mappers.getMapper(UserConverter.class);

    /**
     * LoginUserDTO转VO对象
     *
     */
    @Mappings({
            @Mapping(source = "id", target = "userId"),
            @Mapping(source = "username", target = "userName")
    })
    UserVO loginUserDTOToUserVO(LoginUserDTO loginUserDTO);
}
